Skip to content

Comments

Add integration tests for config sensitive masking in airflowctl#61105

Merged
bugraoz93 merged 5 commits intoapache:mainfrom
Subham-KRLX:test/airflowctl-config-masking-integration
Feb 11, 2026
Merged

Add integration tests for config sensitive masking in airflowctl#61105
bugraoz93 merged 5 commits intoapache:mainfrom
Subham-KRLX:test/airflowctl-config-masking-integration

Conversation

@Subham-KRLX
Copy link
Contributor

Description

Added integration tests to verify sensitive config values are properly masked end-to-end when using airflowctl with actual Airflow API.

The Airflow API masks sensitive values (like fernet_key, sql_alchemy_conn) as < hidden >. These integration tests confirm that airflowctl correctly preserves and displays those masked values in real scenarios.

Changes

  • Added test_config_sensitive_masking.py to airflow-ctl-tests
  • 3 integration test cases covering:
    • config list command
    • config get for fernet_key
    • config get for sql_alchemy_conn
  • Tests run against actual docker-compose Airflow environment
  • Verifies < hidden > appears in output for sensitive configs

Related PRs

Related Issue

Closes #59843

Testing

# Run from airflow-ctl-tests directory
pytest tests/airflowctl_tests/test_config_sensitive_masking.py -v

@potiuk
Copy link
Member

potiuk commented Jan 27, 2026

Some static checks fail

@Subham-KRLX Subham-KRLX force-pushed the test/airflowctl-config-masking-integration branch from 64b0f52 to 2410823 Compare February 1, 2026 03:37
@Subham-KRLX Subham-KRLX requested a review from bugraoz93 February 3, 2026 11:43
@Subham-KRLX
Copy link
Contributor Author

@bugraoz93 @potiuk Refactoring complete. I have cleaned up the code duplication by moving shared logic to conftest.py as suggested. I have verified that the end-to-end masking tests still pass and static checks are green Please merge this PR when you have a moment.

@bugraoz93 bugraoz93 force-pushed the test/airflowctl-config-masking-integration branch from 9b71672 to 9bff783 Compare February 7, 2026 10:27
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks! Rebased to see the CI then we can merge :)

@bugraoz93
Copy link
Contributor

This way, we prevented the test file from getting bigger and bigger for specific use cases. We will also be able to add more with a few lines

@bugraoz93 bugraoz93 added the full tests needed We need to run full set of tests for this PR to merge label Feb 7, 2026
@bugraoz93 bugraoz93 closed this Feb 7, 2026
@bugraoz93 bugraoz93 reopened this Feb 7, 2026
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you run the integration test with breeze? I saw your test hasn't picked up by CI so I assume we should add something to somewhere else. This check gives confidence to our releases so we should ensure it rans. Could you please check? We are using pytest so I suspect pytest hasn't picked up because infra looks okay for command test and others
https://github.com/apache/airflow/actions/runs/21778855360/job/62840600175?pr=61105

…scovery

- Remove @pytest.mark.flaky decorator from test_config_sensitive_masking.py as suggested
- Fix CI test discovery by changing hardcoded path in run_tests.py from
  'test_airflowctl_commands.py' to 'airflowctl_tests' directory to allow
  pytest to discover all test files in the directory
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@bugraoz93 bugraoz93 merged commit 395cb1e into apache:main Feb 11, 2026
126 of 127 checks passed
Alok-kumar-priyadarshi pushed a commit to Alok-kumar-priyadarshi/airflow that referenced this pull request Feb 11, 2026
…che#61105)

* Add integration tests for config sensitive masking in airflowctl

* Fix static check failures: Sort imports in test_config_sensitive_masking.py

* Refactor integration tests to reduce duplication by moving shared logic to conftest.py

* Fix static checks in conftest.py

* Address PR review feedback: Remove flaky decorator and fix CI test discovery

- Remove @pytest.mark.flaky decorator from test_config_sensitive_masking.py as suggested
- Fix CI test discovery by changing hardcoded path in run_tests.py from
  'test_airflowctl_commands.py' to 'airflowctl_tests' directory to allow
  pytest to discover all test files in the directory
Ratasa143 pushed a commit to Ratasa143/airflow that referenced this pull request Feb 15, 2026
…che#61105)

* Add integration tests for config sensitive masking in airflowctl

* Fix static check failures: Sort imports in test_config_sensitive_masking.py

* Refactor integration tests to reduce duplication by moving shared logic to conftest.py

* Fix static checks in conftest.py

* Address PR review feedback: Remove flaky decorator and fix CI test discovery

- Remove @pytest.mark.flaky decorator from test_config_sensitive_masking.py as suggested
- Fix CI test discovery by changing hardcoded path in run_tests.py from
  'test_airflowctl_commands.py' to 'airflowctl_tests' directory to allow
  pytest to discover all test files in the directory
choo121600 pushed a commit to choo121600/airflow that referenced this pull request Feb 22, 2026
…che#61105)

* Add integration tests for config sensitive masking in airflowctl

* Fix static check failures: Sort imports in test_config_sensitive_masking.py

* Refactor integration tests to reduce duplication by moving shared logic to conftest.py

* Fix static checks in conftest.py

* Address PR review feedback: Remove flaky decorator and fix CI test discovery

- Remove @pytest.mark.flaky decorator from test_config_sensitive_masking.py as suggested
- Fix CI test discovery by changing hardcoded path in run_tests.py from
  'test_airflowctl_commands.py' to 'airflowctl_tests' directory to allow
  pytest to discover all test files in the directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove config sensitive data from airflowctl

3 participants